<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<h1 id="title"></h1>
	<input type="text" id="haha">
	<script type="text/javascript">
		function id(a){
			return document.getElementById(a)
		}
		id('haha').oninput = function (e){
			id('title').innerHTML = e.target.value;
		}
		id('haha').onchange = function (e){
			document.title = e.target.value;
		}
	</script>
</body>
</html>